{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 题目 1\n",
    "1. 用户指定上下界\n",
    "2. 输出7和3的倍数\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "s:  10\n",
      "e:  1\n"
     ]
    }
   ],
   "source": [
    "s = int(input('s: '))\n",
    "e = int(input('e: '))\n",
    "i = s\n",
    "while i <= e:\n",
    "    if i % 7 == 0 or i % 3 == 0:\n",
    "        print(i)\n",
    "    i += 1   "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 题目 2\n",
    "1. 用户指定题目数量\n",
    "2. ~~四种运算数目相等~~(随机出现)\n",
    "3. 运算数小于100\n",
    "4. 加减乘结果0 - 100整数\n",
    "5. 除法整除"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "题目数:  10\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "42 - 21\n",
      "88 / 8\n",
      "0 / 11\n",
      "16 + 82\n",
      "75 - 9\n",
      "33 / 1\n",
      "9 * 10\n",
      "1 * 46\n",
      "55 + 43\n",
      "4 + 59\n"
     ]
    }
   ],
   "source": [
    "import random\n",
    "\n",
    "x = int(input('题目数: '))\n",
    "i = 0\n",
    "while i < x:\n",
    "    a = random.randint(0, 99)\n",
    "    b = random.randint(1, 99)\n",
    "    o = random.randint(1, 4) # 1 <= N <= 4\n",
    "    if o == 1:\n",
    "        r = a + b\n",
    "        while r > 100:\n",
    "            a = random.randint(0, 99)\n",
    "            b = random.randint(1, 99)\n",
    "            r = a + b\n",
    "        print(a, '+', b)\n",
    "    elif o == 2:\n",
    "        r = a - b\n",
    "        while r < 0:\n",
    "            a = random.randint(0, 99)\n",
    "            b = random.randint(1, 99)\n",
    "            r = a - b\n",
    "        print(a, '-', b)\n",
    "    elif o == 3:\n",
    "        r = a * b\n",
    "        while r > 100:\n",
    "            a = random.randint(0, 99)\n",
    "            b = random.randint(1, 99)\n",
    "            r = a * b\n",
    "        print(a, '*', b)\n",
    "    elif o == 4:\n",
    "        r = a / b\n",
    "        while r != int(r):\n",
    "            a = random.randint(0, 99)\n",
    "            b = random.randint(1, 99)\n",
    "            r = a / b\n",
    "        print(a, '/', b)\n",
    "        \n",
    "    i += 1"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
